

// util 工具方法测试
var util = require("../lib/util.js");

var typeObjects = [123, "tx", new Date(), function () { }, [23, "e"], new Error(), null, undefined, { name: "" }, new Object(null), /[xy]/];

for (var index = 0; index < typeObjects.length; index++) {
	!function () {
		var constIndex = index;
		var eletypeObjects = typeObjects[constIndex];
		setTimeout(function () {

			console.log("---------------------------------------------------");
			console.log(eletypeObjects + "   : ");
			console.log("isNull  : " + util.isNull(eletypeObjects));
			console.log("isUndefined  : " + util.isUndefined(eletypeObjects));
			console.log("isNullOrUndefined  : " + util.isNullOrUndefined(eletypeObjects));
			console.log("isNumber  : " + util.isNumber(eletypeObjects));
			console.log("isString  : " + util.isString(eletypeObjects));
			console.log("isDate  : " + util.isDate(eletypeObjects));
			console.log("isArray  : " + util.isArray(eletypeObjects));
			console.log("isBoolean  : " + util.isBoolean(eletypeObjects));
			console.log("isFunction  : " + util.isFunction(eletypeObjects));
			console.log("isObject  : " + util.isObject(eletypeObjects));
			console.log("isError  : " + util.isError(eletypeObjects));
			console.log("isRegExp  : " + util.isRegExp(eletypeObjects));

			console.log("---------------------------------------------------");

		}, 5000 * constIndex);
	} ();
}


// 继承测试

function Person() {
};
Person.prototype.eat = function () {
	console.log("person is eating");
};


function Student() {
	Person.call(this);
};

util.inherits(Student, Person);



var student = new Student();
student.eat();

// 文件路径测试

var filePath = "e:\\tiletest\\ms.tif";
console.log(util.basename(filePath));
console.log(util.extname(filePath));


var fileName = "ms3.tif";
console.log(util.extname(fileName));














